﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="mostPopular.aspx.vb" Inherits="Prototype.mostPopular" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
 .tablestat
{
    border-collapse: collapse;
    border: 1px solid #03476F;
    font: normal 11px verdana, arial, helvetica, sans-serif;
    width:100%;
}
.td1
{
height:50px;
vertical-align:top;
}
tr {
    border-bottom: 1px solid black;
    border-top: 1px solid black;
    border-collapse: collapse;
}​
</style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="tablestat">
    <tr>
 <td class="td1">
 <h1> MOST Viewed Books </h1>
 
 <br />
 <br />
 <br />
 <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
         DataSourceID="Views1">
     <Columns>
         <asp:HyperLinkField DataNavigateUrlFields="BookFkId" 
             DataNavigateUrlFormatString="Details.aspx?ID={0}" DataTextField="BookName" 
             HeaderText="BookName" />
         <asp:BoundField DataField="ViewCount" HeaderText="Count" 
             SortExpression="ViewCount" />
     </Columns>
     </asp:GridView>
     <asp:SqlDataSource ID="Views1" runat="server" 
         ConnectionString="<%$ ConnectionStrings:booksConn %>" 
         ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
         SelectCommand="SELECT TOP 5 * FROM [StatViewView]"></asp:SqlDataSource>
 </td>
 <td>
      <asp:Chart ID="Chart4" runat="server" DataSourceID="Views2">
         <series><asp:Series Name="Series1" XValueMember="Bookname" 
                 YValueMembers="ViewCount"></asp:Series></series>
         <chartareas><asp:ChartArea Name="ChartArea1"></asp:ChartArea></chartareas>
     </asp:Chart>
 
      <asp:SqlDataSource ID="Views2" runat="server" 
          ConnectionString="<%$ ConnectionStrings:booksConn %>" 
          ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
          SelectCommand="SELECT TOP 5 [ViewCount], [Bookname] FROM [StatViewView]">
      </asp:SqlDataSource>
 
 </td>
 </tr>
 <tr>
 <td class="td1">
 <h1> MOST&nbsp; Liked Books </h1>
 <br />
 <br />
 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
         DataSourceID="LikedDataSource1">
     <Columns>
         <asp:HyperLinkField DataNavigateUrlFields="BookFkId" 
             DataNavigateUrlFormatString="Details.aspx?ID={0}" DataTextField="BookName" 
             HeaderText="BookName" />
         <asp:BoundField DataField="LikeCount" HeaderText="Count" 
             SortExpression="LikeCount" />
     </Columns>
     </asp:GridView>
     <asp:SqlDataSource ID="LikedDataSource1" runat="server" 
         ConnectionString="<%$ ConnectionStrings:booksConn %>" 
         ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
         SelectCommand="SELECT TOP 5 * FROM [StatLikeView]"></asp:SqlDataSource>
 </td>
 <td>
      <asp:Chart ID="Chart1" runat="server" DataSourceID="Liked2">
         <series><asp:Series Name="Series1" XValueMember="Bookname" 
                 YValueMembers="LikeCount"></asp:Series></series>
         <chartareas><asp:ChartArea Name="ChartArea1"></asp:ChartArea></chartareas>
     </asp:Chart>
 
      <asp:SqlDataSource ID="Liked2" runat="server" 
          ConnectionString="<%$ ConnectionStrings:booksConn %>" 
          ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
          SelectCommand="SELECT TOP 5 [LikeCount], [Bookname] FROM [StatLikeView]">
      </asp:SqlDataSource>
 
 </td>
 </tr>
 <tr>
 <td class="td1">
 <h1> MOST Rated Books</h1>
 <br />
 <br />
     <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
         DataSourceID="Average1">
         <Columns>
         <asp:HyperLinkField DataNavigateUrlFields="BookFkId" 
             DataNavigateUrlFormatString="Details.aspx?ID={0}" DataTextField="BookName" 
             HeaderText="BookName" />
         <asp:BoundField DataField="AVG_Rating" HeaderText="Count" 
             SortExpression="AVG_Rating" />
     </Columns>
     </asp:GridView>
 
     <asp:SqlDataSource ID="Average1" runat="server" 
         ConnectionString="<%$ ConnectionStrings:booksConn %>" 
         ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
         SelectCommand="SELECT TOP 5 * FROM [bookAvgRatingView]"></asp:SqlDataSource>
 
 </td>
 <td>
 
     <asp:Chart ID="Chart3" runat="server" DataSourceID="Average2">
         <Series>
             <asp:Series Name="Series1" XValueMember="Bookname" YValueMembers="AVG_Rating">
             </asp:Series>
         </Series>
         <ChartAreas>
             <asp:ChartArea Name="ChartArea1">
             </asp:ChartArea>
         </ChartAreas>
     </asp:Chart>
     <asp:SqlDataSource ID="Average2" runat="server" 
         ConnectionString="<%$ ConnectionStrings:booksConn %>" 
         ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
         SelectCommand="SELECT TOP 5 [AVG_Rating], [Bookname] FROM [bookAvgRatingView]">
     </asp:SqlDataSource>
 
 </td>
 </tr>
 
 <tr>
 <td class="td1">
 <h1> MOST Commented Books</h1>
 <br />
 <br />
     <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
         DataSourceID="Commented1">
         <Columns>
         <asp:HyperLinkField DataNavigateUrlFields="BookFkId" 
             DataNavigateUrlFormatString="Details.aspx?ID={0}" DataTextField="BookName" 
             HeaderText="BookName" />
         <asp:BoundField DataField="CommentCount" HeaderText="Count" 
             SortExpression="CommentCount" />
     </Columns>
     </asp:GridView>
 
     <asp:SqlDataSource ID="Commented1" runat="server" 
         ConnectionString="<%$ ConnectionStrings:booksConn %>" 
         ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
         
         SelectCommand="SELECT TOP 5 * FROM [StatCommentView]"></asp:SqlDataSource>
 
 </td>
 <td>
 
     <asp:Chart ID="Chart2" runat="server" DataSourceID="Commented2">
         <Series>
             <asp:Series Name="Series1" XValueMember="Bookname" YValueMembers="CommentCount">
             </asp:Series>
         </Series>
         <ChartAreas>
             <asp:ChartArea Name="ChartArea1">
             </asp:ChartArea>
         </ChartAreas>
     </asp:Chart>
     <asp:SqlDataSource ID="Commented2" runat="server" 
         ConnectionString="<%$ ConnectionStrings:booksConn %>" 
         ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
         SelectCommand="SELECT TOP 5 [CommentCount], [Bookname] FROM [StatCommentView]">
     </asp:SqlDataSource>
 
 </td>
 </tr>
 
 <tr>
 <td class="td1">
 <h1> MOST Commented BY</h1>
 <br />
 <br />
     <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False" 
         DataSourceID="UserComment">
         <Columns>
         <asp:BoundField DataField="UserFkName" HeaderText="UserFkName" 
             SortExpression="UserFkName" />
             <asp:BoundField DataField="CommentCount" HeaderText="CommentCount" 
                 SortExpression="CommentCount" />
     </Columns>
     </asp:GridView>
 
 </td>
 <td>
 
     <asp:Chart ID="Chart5" runat="server" DataSourceID="UserComment">
         <Series>
             <asp:Series Name="Series1" XValueMember="UserFkName" 
                 YValueMembers="CommentCount">
             </asp:Series>
         </Series>
         <ChartAreas>
             <asp:ChartArea Name="ChartArea1">
             </asp:ChartArea>
         </ChartAreas>
     </asp:Chart>
     <asp:SqlDataSource ID="UserComment" runat="server" 
         ConnectionString="<%$ ConnectionStrings:booksConn %>" 
         ProviderName="<%$ ConnectionStrings:booksConn.ProviderName %>" 
         SelectCommand="SELECT TOP 5 [UserFkName], [CommentCount] FROM [StatUserCommentView]">
     </asp:SqlDataSource>
 
 </td>
 </tr>
 </table>
</asp:Content>
